package com.hfkh;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
//1)使用二维数组存储班上五个学生三门功课的考试成绩
// 要求输出每一个学生的总分、平均分、最高分、最低分
public class No_1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] score = new int[5][3];
        int total = 0;
        for (int i = 0; i < score.length; i++) {
            System.out.println("第"+(i+1)+"个学生的考试成绩");
            int max,min;
            max = min = -1;
            double avg = 0;
            for (int j = 0; j < score[i].length; j++) {
                System.out.print("\t第"+(j+1)+"门功课的分数:");
                score[i][j] = sc.nextInt();
                total += score[i][j];
                avg = total / score[i][j];
                if (min==-1){
                    min = score[i][j];
                }
                    if (score[i][j]>max){
                        max = score[i][j];
                    }
                    if (score[i][j]<min){
                        min = score[i][j];
                    }
            }
            System.out.println("总成绩："+total+"\t最高分："+max+"\t最低分："+min+"\t平均分："+avg);

        }
    }
}
